from django.conf.global_settings import AUTH_USER_MODEL
from django.contrib.auth.models import AbstractUser
from django.db import models

# Create your models here.


class User(AbstractUser):
    employee_id = models.CharField(unique=True, max_length=10)

    REQUIRED_FIELDS = ['email', 'employee_id']


class OverworkSignup(models.Model):
    work_start_at = models.DateTimeField()
    work_end_at = models.DateTimeField()
    rest_start_at = models.DateTimeField()
    rest_end_at = models.DateTimeField()
    content = models.CharField(max_length=500)
    user = models.ForeignKey(User, on_delete=models.CASCADE)

    class Meta:
        ordering = ('-id',)
